//
//  myDetailsCell.m
//  livingDesign
//
//  Created by dlios on 15-1-30.
//  Copyright (c) 2015年 怡居. All rights reserved.
//

#import "myDetailsCell.h"

@implementation myDetailsCell
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //自定义label
        self.myLabel = [[UILabel alloc] init];
        [self.contentView  addSubview: _myLabel];
        self.myLabel.font = [UIFont systemFontOfSize:10];
        self.myLabel.numberOfLines = 0;
        [self.myLabel sizeToFit];
       
        [_myLabel release];
        //自定义imageview
        self.imageView = [[UIImageView alloc] init];
        [self.contentView addSubview:_imageView];
        [_imageView release];
        
    }
    return self;
}
//设置大小
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.imageView.frame = CGRectMake(self.frame.size.width / 8 - 8, self.frame.size.height / 8 - 12,  self.frame.size.width * 3 / 4 + 12, self.frame.size.height * 6 / 8 );
    
    self.myLabel.frame = CGRectMake(self.frame.size.width / 7, self.frame.size.height * 7 / 9 + 8,  self.frame.size.width * 3 / 4, self.frame.size.height / 4);
    

    
    
}


//内存管理
- (void)dealloc
{
    [_myLabel release];
    [_imageView release];
    [super dealloc];
}
@end
